//
//  WYCOneViewController.m
//  快付钱包
//
//  Created by 王晓民 on 2018/3/20.
//  Copyright © 2018年 中企互联. All rights reserved.
//

#import "WYCOneViewController.h"

@interface WYCOneViewController ()
@property (strong , nonatomic) UIWebView *detailWeb;

@end

@implementation WYCOneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *strHtml = @"https://shop13291470.wxrrd.com/feature/10316185";
    _detailWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0, NavHeight, ScreenWidth, ScreenHeight-NavHeight)];
    
    NSString *encodeStr = [strHtml stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSLog(@"wqc====%@", encodeStr);
    
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:encodeStr]];
    [self.view addSubview: _detailWeb];
    [_detailWeb loadRequest:request];
}

- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBar.hidden = YES;
    
    
    UIView * NavView = [[UIView alloc] init];
    NavView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    NavView.backgroundColor = WYCMain;
    [self.view addSubview:NavView];
    
//    //返回按钮
//    UIButton *  addbutton = [[UIButton alloc] init];
//    [addbutton setImage:[UIImage imageNamed:@"Three"] forState:UIControlStateNormal];
//    [addbutton addTarget:self action:@selector(ThreeClick:) forControlEvents:UIControlEventTouchUpInside];
//    addbutton.frame = CGRectMake(NavView.width - 96 * px, titleY, 66 * px , 66 * px);
//    [NavView addSubview:addbutton];
    
    //    self.bottomLineLayer = [[CALayer alloc] init];
    //    self.bottomLineLayer.frame = CGRectMake(0, NavView.bounds.size.height - 0.5, NavView.bounds.size.width, 0.5);
    //    self.bottomLineLayer.backgroundColor = WYCRGBColor(191, 191, 196).CGColor;
    //    [NavView.layer addSublayer:self.bottomLineLayer];
    
    
    //返回按钮
    UIButton * backbutton = [[UIButton alloc] init];
    [backbutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [backbutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    backbutton.frame = CGRectMake(30 * px, titleY, 66 * px , 66 * px);
    [NavView addSubview:backbutton];
    
    
    UILabel * NavRigsterLabel = [[UILabel alloc] init];
    NavRigsterLabel.frame = CGRectMake(0, titleY, NavView.width, 68 * px);
    NavRigsterLabel.textColor = [UIColor whiteColor];
    NavRigsterLabel.font = [UIFont boldSystemFontOfSize:BigFont];
    NavRigsterLabel.textAlignment = NSTextAlignmentCenter;
    NavRigsterLabel.text = @"水果商城";
    [NavView addSubview:NavRigsterLabel];
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
